package ch.bfh.abhmcm.SoftwareEngineeringAndDesign.controller;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.Timer;

import ch.bfh.abhmcm.SoftwareEngineeringAndDesign.controller.exportRFC.ActualiseNewsListThread;
import ch.bfh.abhmcm.SoftwareEngineeringAndDesign.view.mainframe.exportRFCPanel.ExportRFCPanel;

public class RFCNewsTicker {

	
	private Timer timer;
	private ActualiseNewsListThread newsListThread;
	private ExportRFCPanel exportRFCPanel;
	
	public RFCNewsTicker(ExportRFCPanel exportRFCPanel){
		
		this.exportRFCPanel = exportRFCPanel;
		this.timer = new Timer(3000, new TimerAction());
		this.timer.start();
	}
	
	private class TimerAction implements ActionListener{

		@Override
		public void actionPerformed(ActionEvent arg0) {

			newsListThread = new ActualiseNewsListThread(exportRFCPanel);
			
			newsListThread.start();
			
		}
		
	}
	
	
	
}
